package com.controller;

import com.entity.ResponseEntity;
import com.service.RbacPermService;
import com.service.RbacRoleService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 字典请求的统一接口
 * @Todo 前端字典对应的controller层
 *
 * @author a0112
 * @date 2022/04/17
 */
@RestController
@RequestMapping("/dicts")
public class DictController {
    @Autowired
    RbacPermService rbacPermService;
    @Autowired
    RbacRoleService rbacRoleService;

    /**
     * 查询所有的角色列表
     *
     * @return {@link ResponseEntity} 封装了所有角色信息的统一响应实体
     */
    @GetMapping("/roles")
    public ResponseEntity getRoles(){
        return rbacRoleService.findAll();
    }

    /**
     * @Todo 查询返回所有权限列表
     *
     * @return {@link ResponseEntity} 封装了所有权限信息的统一响应实体
     */
    @GetMapping("/perms")
    private ResponseEntity getPerms(){
        return null;
    }
    @GetMapping("/lists")
    private ResponseEntity getLists(){
        return null;
    }

//    private ResponseEntity<List<String>> getStrings(ResponseEntity<List> old){
//        List list = old.getData();
//
//    }
}
